import { defineStore } from 'pinia';
import { ref } from "vue";
import { useDark, useToggle } from '@vueuse/core'

if (!localStorage.getItem("vueuse-color-scheme")) {
    localStorage.setItem("vueuse-color-scheme","light")
}
const isDark = useDark();
const toggleDark = useToggle(isDark)
export const useDarkStore = defineStore('dark', {
    actions: {
        setDark(){
            toggleDark()
        }
    },


    state: () => ({
        dark:ref(isDark),
    }),
})
